﻿<UserControl x:Class="RFW.Silverlight.Weather.WindDirection"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300" SizeChanged="UserControl_SizeChanged">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="20" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Canvas SizeChanged="Canvas_SizeChanged" Grid.Column="0" Grid.RowSpan="2">
            <Ellipse Name="elForeground" Height="300" Width="300" Stroke="Black" />
            <Ellipse Margin="20" Name="elBackground" Height="260" Width="260" Stroke="Black">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="Blue" Offset="0"/>
                        <GradientStop Color="Black" Offset="1.5"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <Path Margin="20">
                <Path.Data>
                    <EllipseGeometry x:Name="elCenter" Center="150,150" RadiusX="10" RadiusY="10" />
                </Path.Data>
                <Path.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="DarkGray" Offset="0"/>
                        <GradientStop Color="LightGray" Offset="1.5"/>
                    </RadialGradientBrush>
                </Path.Fill>
            </Path>
            <Polygon Name="pgDirection" Points="150,0 145,145 155,145 150,0">
                <Polygon.Fill>
                    <LinearGradientBrush>
                        <GradientStop Color="White" Offset="1.5"/>
                        <GradientStop Color="Red" Offset="0"/>
                    </LinearGradientBrush>
                </Polygon.Fill>
                <Polygon.RenderTransform>
                    <RotateTransform x:Name="pgAngle" Angle="0" />
                </Polygon.RenderTransform>
            </Polygon>
        </Canvas>
        <TextBlock Margin="5" Grid.Column="0" Grid.Row="2" FontSize="14" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Top" TextWrapping="Wrap" UseLayoutRounding="True" TextAlignment="Center">
            <Run x:Name="txtDirection" Text="---" />
            <Run Text="°" />
            <LineBreak />
            <Run x:Name="txtSpeed" Text="---"/>
            <Run Text=" mph" />
        </TextBlock>
        <TextBlock Margin="2" Grid.Column="0" Grid.Row="0" FontSize="14" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top" Text="N" />
        <TextBlock Margin="2" Grid.Column="0" Grid.Row="2" FontSize="14" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Bottom" Text="S" />
        <TextBlock Margin="2" Grid.Column="0" Grid.Row="1" FontSize="14" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Text="W" />
        <TextBlock Margin="2" Grid.Column="0" Grid.Row="1" FontSize="14" FontWeight="Bold" HorizontalAlignment="Right" VerticalAlignment="Center" Text="E" />
    </Grid>

</UserControl>
